package com.example.freshfoodproject.service.impl;

import com.example.freshfoodproject.entry.Orders;
import com.example.freshfoodproject.mapper.OrderMapper;
import com.example.freshfoodproject.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderServiceImpl implements OrderService {
    @Autowired
    private OrderMapper orderMapper;
    @Override
    public boolean addOrder(Orders orders) {
        return orderMapper.insertOrder(orders)==1?true:false;
    }

    @Override
    public List<Orders> findOrders() {
        return orderMapper.selectOrders();
    }

    @Override
    public boolean removeCode(String orderCode) {
        return orderMapper.deleteCode(orderCode)==1?true:false;
    }
}
